﻿using FastText.NetWrapper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace FastTextDemo
{
    public class FastTextHelper
    {
        private static string modelPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lid.176.bin");
        private static FastTextWrapper fastTextWrapper = new FastTextWrapper();
        static FastTextHelper()
        {
            fastTextWrapper.LoadModel(modelPath);
        }

        public static Prediction PredictLanguage(string text)
        {
            return fastTextWrapper.PredictSingle(text);
        }
    }
}
